---
title: "Domain Model — RVC Controller SW v2"
---
classDiagram
    class RVC {
        -RVCState state
    }
    class Controller {
        -int pollingInterval
    }
    class MovementUnit {
        -Direction currentDirection
        -float speed
    }
    class CleaningUnit {
        -PowerLevel powerLevel
        -int boostDuration
        -boolean isActive
    }
    class Sensor {
        <<abstract>>
        -String sensorId
        -SensorStatus status
    }
    class ObstacleSensor {
        -SensorPosition position
        -boolean obstacleDetected
    }
    class DustSensor {
        -float dustLevel
        -boolean dustDetected
    }
    class Obstacle {
        -SensorPosition detectedAt
    }
    class Dust {
        -float concentration
    }

    class RVCState {
        <<enumeration>>
        CLEANING
        STOPPED
        TURNING
        REVERSING
    }
    class Direction {
        <<enumeration>>
        FORWARD
        BACKWARD
        LEFT
        RIGHT
    }
    class PowerLevel {
        <<enumeration>>
        NORMAL
        BOOSTED
    }
    class SensorStatus {
        <<enumeration>>
        ACTIVE
        ERROR
    }
    class SensorPosition {
        <<enumeration>>
        FRONT
        LEFT
    }

    RVC "1" *-- "1" Controller
    RVC "1" *-- "1" MovementUnit
    RVC "1" *-- "1" CleaningUnit
    Controller "1" o-- "1..*" Sensor
    Controller "1" --> "1" MovementUnit
    Controller "1" --> "1" CleaningUnit
    Sensor <|-- ObstacleSensor
    Sensor <|-- DustSensor
    ObstacleSensor "1" ..> "0..1" Obstacle
    DustSensor "1" ..> "0..1" Dust
    RVC .. RVCState
    MovementUnit .. Direction
    CleaningUnit .. PowerLevel
    Sensor .. SensorStatus
    ObstacleSensor .. SensorPosition

    style SensorPosition fill:#fff3e0,stroke:#e65100,stroke-width:2px
    style ObstacleSensor fill:#fff3e0,stroke:#e65100,stroke-width:2px
